﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace park.SIM
{
    public partial class SIMList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string method = Request.Params["method"];
                if (!string.IsNullOrEmpty(method))
                {
                    switch (method)
                    {
                        case "search":
                            PrintResult();
                            break;
                        default:
                            Response.End();
                            break;
                    }

                }
            }
        }

        string fix(string key)
        {
            if (Request.Params[key] != null)
            {
                try
                {
                    return Uri.UnescapeDataString(Request.Params[key]);
                }
                catch
                {
                    return Request.Params[key];
                }
            }
            return "";
        }


        private void PrintResult()
        {

            #region 正式代码
            ////string strCode = fix("code");
            ////string strTelephone = fix("telephone");
            ////string strUser = fix("user");
            ////string strBeginDate = fix("beginDate");
            ////string strEndDate = fix("endDate");

            ////int page = int.Parse(Request.Params["page"]);
            ////int size = int.Parse(Request.Params["size"]);

            ////cn.linkit.epark.ServiceList sl = new cn.linkit.epark.ServiceList();

            ////string json = sl.GetSIMCardList(strCode,strTelephone,strUser,strBeginDate,strEndDate, page, size);

            ////Response.Write(json);
            ////Response.End();
            #endregion

            #region 测试代码
        //    int total = 100;
        //    string result = ""
        //        + "[{"
        //+ "\"Code\": \"sim_0001\","
        //+ "\"Telephone\": \"18627870000\","
        //+ "\"AMT\": 100,"
        //+ "\"User\": \"张三\","
        //+ "\"AddDate\": \" 2012-8-20 22:22:30\""
        //        + "},"
        //        + "{"
        //+ "\"Code\": \"sim_0002\","
        //+ "\"Telephone\": \"18627870000\","
        //+ "\"AMT\": 100,"
        //+ "\"User\": \"张三\","
        //+ "\"AddDate\": \" 2012-8-20 22:22:30\""
        //        + "}]";
        //    string json = string.Empty;

        //    json = "{\"SIMCardList\":" + result + ",\"RowsCount\":" + total + "}";

        //    Response.Write(json);
        //    Response.End();
            //测试代码---------------------------
            #endregion


        }
    }
}